<?

/*
    $matches = array();
    preg_match_all("/(a href\=\")([^\?\"]*)(\")/i", get_text('http://treaties.un.org/doc/Publication/MTDSG/'), $matches);
    foreach($matches[2] as $match)
    {
        echo $match . '<br><pre>';
        var_dump($match);
        echo '</pre>';
    }

    function get_text($filename)
    {
        $fp_load = fopen("$filename", "rb");
        if ( $fp_load )
        {
            while ( !feof($fp_load) )
            {
                $content .= fgets($fp_load, 8192);
            }
            fclose($fp_load);
        return $content;
        }
    }*/

// create a new cURL resource
echo 0;
$ch = curl_init();
echo 1;
var_dump($ch);


// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);
echo 2;
?>